package com.jeecms.cms.dao.main;

import com.jeecms.cms.entity.assist.Branch;
import com.jeecms.common.hibernate4.Updater;
import com.jeecms.common.page.Pagination;

import java.util.List;

public interface BranchDao {

    /**
     * 获得顶级组织架构
     *
     * @param siteId
     *            站点ID
     * @param hasEnterpriseOnly
     *            是否只获得有企业的组织架构
     * @return
     */
    public List<Branch> getTopList(Integer siteId, boolean hasEnterpriseOnly, boolean cacheable);

    public List<Branch> getTopListByRigth(Integer userId, Integer siteId,boolean hasEnterpriseOnly, boolean cacheable);

    public List<Branch> getTopListForTag(Integer siteId, boolean hasEnterpriseOnly, boolean cacheable);

    public Pagination getTopPageForTag(Integer siteId, boolean hasEnterpriseOnly, int pageNo, int pageSize);

    public List<Branch> getChildList(Integer parentId, boolean hasEnterpriseOnly, boolean cacheable);

    public List<Branch> getChildListByRight(Integer userId, Integer siteId,Integer parentId, boolean hasEnterpriseOnly, boolean cacheable);

    public List<Branch> getChildListForTag(Integer parentId,boolean hasEnterpriseOnly, boolean cacheable);

    public List<Branch> getBottomList(Integer siteId,boolean hasEnterpriseOnly, boolean cacheable);

    public Pagination getChildPageForTag(Integer parentId,boolean hasEnterpriseOnly, int pageNo, int pageSize);


    public Branch findById(Integer id);

    public Branch save(Branch bean);

    public Branch copy(Integer bid, Integer siteId);

    public Branch updateByUpdater(Updater<Branch> updater);

    public Branch update(Branch bean);

    public Branch deleteById(Integer id);

    public Branch[] updatePriority(Integer[] ids, Integer[] priority);

    public void initWorkFlow(Integer workflowId);

    public String checkDelete(Integer id);
}
